var PlayLayer=cc.Layer.extend({
	backgroundLayer : null,
	mainLayar : null,
	tipLayer : null,
	flow:null,
	ctor:function(){
		this._super();
		this.initFrames();
		gg.initTeach();
		this.flow=new TeachFlow(this);
		this.backgroundLayer=new PlayBackgroundLayer(this);
//		this.backgroundLayer=new cc.LayerColor(cc.color(20, 40, 50, 255));
//		this.addChild(this.backgroundLayer);
		this.mainLayer=new PlayMainLayer(this,TAG_G5_PLAYMAIN);
		this.tipLayer=new TipLayer(this);
		this.toolLayer=new ToolLayer(this);
		this.flow.init(this.tipLayer.tip,this.tipLayer.tip_frame, this.tipLayer.flash);
		if(teach_type == TAG_LEAD){
			var fontDef = new cc.FontDefinition();
			fontDef.fontName = "Arial";
			fontDef.fontSize = "32";
			var label=new cc.LabelTTF("请点击闪烁部分进行相应的操作",fontDef);
			label.setPosition(cc.p(gg.c_width, gg.c_height*1.68));
			label.setFontFillColor(cc.color(0,0,0, 0));	
			this.addChild(label);
			label.runAction(cc.sequence(cc.delayTime(3),cc.callFunc(function a(){
				label.setVisible(false);
			},this)));
		}
		this.flow.start();
		this.flow.next();
	},
	initFrames:function(){
		cc.spriteFrameCache.addSpriteFrames(res_play.play_p);
		cc.spriteFrameCache.addSpriteFrames(res_play.action_p);
	},
	over:function (){
		this.tipLayer.over();
		$.runScene(new FinishScene());
	}
});
var PlayScene=PScene.extend({
	onEnter:function(){
		this._super();
		var layer=new PlayLayer();
		this.addChild(layer);
	}
});
